<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">

    <link rel="stylesheet" href="/cp/Public//css/login.css">
    <script type="text/javascript" src="/cp/Public//js/jquery.min.js"></script>
    <script type="text/javascript">

    function login(){
    	 var username = $(".username").val();
    	 var password = $(".password").val();
    	
    	 if(username==null || username == undefined || username=='' ){
    	 	$("#tips").text("用户名不能为空");
    	 	$(".username").focus();
    	 	return false;

    	 }else if(password == null || password == undefined || password == ''){
    	 	$("#tips").text("密码不能为空");
    	 	$(".password").focus();
    	 	return false;
    	 }
    	$.ajax({
                cache: true,
                type: "POST",
                url:"<?php echo U('member/login');?>",
                data:{'username':username,'password':password},// 你的formid
                async: false,
                error: function(request) {
                    alert("Connection error");
                },
                success: function(data) {
                   var status = data['status'];
                   if (status) {
                   	  window.location="<?php echo U('index/index');?>"
                   }else{
                   	 $("#tips").text(data['info']);
                   }
                  
                }
            });
     
     	return false;
    }

    </script>
	<title>后台登陆</title>
</head>
<body>
	<div id="login_top">
		<div id="welcome">
			管理系统
		</div>
		<div id="back">
			<a href="#">返回首页</a>&nbsp;&nbsp; | &nbsp;&nbsp;
			<a href="#">帮助</a>
		</div>
	</div>
	<div id="login_center">
		<div id="login_area">
			<div id="login_form">
				<form id="loginfrom" method="post" >
					<div id="login_tip">
						用户登录&nbsp;&nbsp;UserLogin
					</div>
					<div><input type="text" class="username"></div>
					<div><input type="password" class="password"></div>
					<div id="btn_area">
						<input type="submit" onclick="return login()" name="submit" id="sub_btn" value="登&nbsp;&nbsp;录">&nbsp;&nbsp;
						<label id="tips" style="color: red"></label>
						<!-- <input type="text" class="verify"> -->
						<!-- <img src="images/login/verify.png" alt="" width="80" height="40"> -->
					</div>
				</form>
			</div>
		</div>
	</div>
	<div id="login_bottom">
		版权所有
	</div>
</body>
</html>